package com.alks.entity.data.enums.biocontrol;

import lombok.Getter;

import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;

/**
 * 产前计划 作业流程
 */
@Getter
public enum PrepairFlowEnum {
    BUSS("业务色卡","buss","BUSS"),
    TECH_BOM("技转核料","techBom","TECH_BOM"),
    TECH_TRAIL("技转试做","techTrail","TECH_TRAIL"),
    SOLE_PUR("大底下单","solePur","SOLE_PUR"),
    UPPER_PUR("面料下单","upperPur","UPPER_PUR"),
    SOCK_MTL("面衬","sockMtl","SOCK_MTL"),
    PACK_MTL("包材","packMtl","PACK_MTL");

    private final String flowName;
    private final String flowCode;
    private final String column;

    PrepairFlowEnum(String flowName,String flowCode,String column){
        this.flowCode = flowCode;
        this.flowName = flowName;
        this.column = column;
    }

    public static List<String> getNameList(){
        return Arrays.stream(PrepairFlowEnum.values()).map(PrepairFlowEnum::getFlowName).collect(Collectors.toList());
    }

    public static String getColumnByName(String flowName){
        for (PrepairFlowEnum value : PrepairFlowEnum.values()) {
            if (value.getFlowName().equals(flowName)) {
                return value.getColumn();
            }
        }
        return null;
    }
}
